export class LoaderManager {
    static onLoader(urls) {
        return new Promise((res) => {
            // 筛选出已经加载过的
            const urlArr = urls.filter((u) => {
                return !LoaderManager.resource[u.name];
            });
            LoaderManager.loader
                ?.add(urlArr)
                .load((loader, resource) => {
                // 加载完成则合并资源
                LoaderManager.resource = { ...LoaderManager.resource, ...resource };
                res();
            });
        });
    }
}
LoaderManager.loader = undefined;
LoaderManager.resource = {};
